    package com.audaque.springboot.foshanupload;

import com.audaque.springboot.foshanupload.core.util.ApplicationContextUtils;
import com.audaque.springboot.foshanupload.core.util.SpringBootApplicationUtil;
import com.audaque.springboot.foshanupload.web.flinkdemo.service.inface.FlinkService;
import lombok.extern.slf4j.Slf4j;
import org.apache.flink.configuration.Configuration;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * @author zgb
 */

@Slf4j
public class FlinkDemoWebJarJob {
    public static void main(String[] args) throws Exception {

        Configuration configuration = new Configuration();
        if (args != null) {
            configuration.setString("args", String.join(" ", args));
        }
        //启动springBoot
        SpringBootApplicationUtil.run(args);


        log.debug("1");
        FlinkService bean = ApplicationContextUtils.getBean(FlinkService.class);
        log.debug("2");
        if (bean != null) {
            log.debug("3");
            bean.textSplitWordCountByDataStreamFromSocket();
            log.debug("4");
        }
        //加一个死循环来保证main方法不会停止
        while (true) {
            Thread.sleep(30000);
        }
    }
}

